﻿package bdz.projects.lavender.doi.ui.core
{
	
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.utils.*;
	/**
	 * ...
	 * @author ...
	 */
	public class InteractiveUIBase extends MovieClip
	{
		private var _dp:Array;
		private var _selected:String;
		private var _label:String;
		
		private var tLabel:TextField;
		private var baseBG:MovieClip;
		
		public function InteractiveUIBase() {
			tLabel = this["tlabel"];
			tLabel.autoSize = "center";	
			baseBG = this["base"];
			align();
			
		}
		private function align():void{
			tLabel.x = Math.ceil(baseBG.width / 2) - Math.ceil(tLabel.width / 2);
			if (this is NButtonUI) {
				tLabel.y = Math.ceil(baseBG.height / 2) - Math.ceil(tLabel.height / 2) - 2;
			}else{
				tLabel.y = Math.ceil(baseBG.height / 2) - Math.ceil(tLabel.height / 2) - 4;
			}
			
		}
		public function setSize(w:Number, h:Number):void {
			baseBG.width = w;
			baseBG.height = h;
			align();
		}
		public function set label(str:String):void {
			trace("setting label");
			tLabel.text = str;	
		}
		public function get label():String {
			return tLabel.text;
		}
	}
	
}